package com.company.behavioral.strategy_pattern.client;

import com.company.behavioral.strategy_pattern.conctete_strategy.StudentDiscount;
import com.company.behavioral.strategy_pattern.context.MovieTicket;
import com.company.behavioral.strategy_pattern.strategy.Discount;

/**
 * @ClassName Client
 * @Author tiezheng.han
 * @Date 2020/9/7 15:48
 **/
public class Client {

    public static void main(String[] args) {
        MovieTicket mt = new MovieTicket();
        double originaPrice = 60;
        double currentPrice;

        mt.setPrice(originaPrice);
        System.out.println("原始价为：" + originaPrice);
        System.out.println("-------------------------");

        Discount discount = new StudentDiscount();
        mt.setDiscount(discount);

        currentPrice = mt.getPrice();
        System.out.println("折扣后价为：" + currentPrice);
    }
}
